package edu.zut.bailan.topicmenu.domain;

import edu.zut.bailan.base.domain.BaseEntity;
import edu.zut.bailan.base.domain.BaseTreeEntity;

import javax.persistence.*;
import java.util.Set;
@Table(name = "T_MENU_GROUP")
@Entity
//@NamedQueries({ @NamedQuery(name = "MenuGroup.getRoot", query = "select g from MenuGroup g where g.parent is null") })
public class TopicMenuGroup extends BaseTreeEntity<TopicMenuGroup, Long> {

    /**
     *
     */
    private static final long serialVersionUID = -7792894821738364098L;

    /**
     * code of menu
     *
     */
    @Column(name = "CODE")
    String code;

    /**
     * name of menu
     *
     */
    @Column(name = "NAME")
    String name;


    /**
     * num of products
     *
     */
    @Column(name = "NUM")
    Integer num;

    /**
     * price of products
     *
     */
    @Column(name = "PRICE")
    Integer price;

    @OneToMany(mappedBy = "menuGroup", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
    Set<TopicMenu> menus;

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }



}
